import React, { Component } from 'react';
import List from './list.jsx';
import Detail from './detail.jsx';

class View extends Component{

    ifPage(id){
        if(id){
            return <Detail id={id}/>
        }else {
            return <List/>
        }
    }
    render(){
        console.log(this.props.match.params.id)
        return(
            <React.Fragment>
                <h3>这是web1904</h3>
                {this.ifPage(this.props.match.params.id)}
            </React.Fragment>
        )
    }
}

export default View;
